from rest_framework.viewsets import ModelViewSet
from django.contrib.auth.models import Permission,ContentType
from meiduo_admin.serializers import permission_serializers
from meiduo_admin.my_paginate import MyPageNumberPagination
from rest_framework.generics import ListAPIView

#1,操作权限
class PermissionView(ModelViewSet):
    pagination_class = MyPageNumberPagination
    serializer_class = permission_serializers.PermissionSerializer
    queryset = Permission.objects.order_by("id")

#2,获取权限类型
class PermissionContentTypeView(ListAPIView):
    serializer_class = permission_serializers.PermissionContentTypeSerializer
    queryset = ContentType.objects.order_by("id")